<#--
    数据库中每张表有基础字段, 需要过滤;
-->
<#assign excludes=["id","uuid","liveflag","createtime"]>
package ${basePackage}.${moduleName}.entity;

<#if (table.hasDateColumn)>
import java.util.Date;
</#if>
<#if (table.hasBigDecimalColumn)>
import java.math.BigDecimal;
</#if>

import com.shop.web.model.BaseModel;
import com.jfinal.log.Log;

/**
* Class title: DB实体 - ${table.tableName} - ${table.remarks} <br/>
* Describe:                    <br/>
* Created by [CodeGenerator]   <br/>
* Date : ${.now}       <br/>
* Project : weixin           <br/>
*/
public class ${table.className} extends BaseModel<${table.className}>{
    /*log工具*/
    private static Log log = Log.getLog(${table.className}.class);
    public final static ${table.className} dao = new ${table.className}();
    /*数据库字段静态变量*/
<#list table.primaryKeys as key>
    <#if !excludes?seq_contains(key.javaProperty)>
    /** ${key.columnName}  ${key.remarks}*/
    public final static String COL_${key.javaProperty?upper_case}="${key.javaProperty}";
    <#--private final static ${key.javaType} ${key.javaProperty};-->
    </#if>
</#list>

<#list table.baseColumns as column>
    <#if !excludes?seq_contains(column.javaProperty)>
    /** ${column.columnName}  ${column.remarks} */
    public final static String COL_${column.javaProperty?upper_case}="${column.javaProperty}";
    </#if>
</#list>
    <#--构造函数-->
    public ${table.className}() {
        if (this.getStr(COL_UUID) == null || this.getStr(COL_UUID).length() == 0) {
        this.set(COL_UUID, generateUUID());
        }
    }
/*================${table.className} 业务方法 start====================*/

/*================${table.className} 业务方法 end====================*/
<#--primary key getter setter-->
<#list table.primaryKeys as key>
    <#if !excludes?seq_contains(key.javaProperty)>
    public ${key.javaType} ${key.getterMethodName}(){
        return this.get(COL_${key.javaProperty?upper_case});
    }
    public void ${key.setterMethodName}(${key.javaType} ${key.javaProperty}){
        this.set(COL_${key.javaProperty?upper_case},${key.javaProperty});
    }
    </#if>
</#list>
<#--column getter setter-->
<#list table.baseColumns as column>
    public ${column.javaType} ${column.getterMethodName}(){
        <#if (column.isString())>
            <#--String getStr-->
            return this.getStr(COL_${column.javaProperty?upper_case});
        <#elseif (column.isBoolean())>
            return this.getBoolean(COL_${column.javaProperty?upper_case});
        <#elseif (column.isDate())>
            return this.getDate(COL_${column.javaProperty?upper_case});
        <#elseif (column.isIntegerNumber())>
            return this.getInt(COL_${column.javaProperty?upper_case});
        <#elseif (column.isBigDecimal())>
            return this.getBigDecimal(COL_${column.javaProperty?upper_case});
        <#elseif (column.isDouble())>
            return this.getDouble(COL_${column.javaProperty?upper_case});
        <#else>
            return this.getStr(COL_${column.javaProperty?upper_case});
        </#if>
    }
    public void ${column.setterMethodName}(${column.javaType} ${column.javaProperty}){
        this.set(COL_${column.javaProperty?upper_case},${column.javaProperty});
    }
</#list>
}